<style scoped>
</style>

<!-- 正文开始 -->
<div class="layui-fluid" style="padding: 5px;">
    <div class="layui-card" style="box-shadow:none;">
        <div class="layui-card-body" style="padding:0px;">
        	<ul id="bizLayerTree" class="ztree" style="max-height: calc(100vh - 65px);overflow-y: auto;overflow-x: hidden;"></ul>
        </div>
    </div>
</div>
<!-- js部分 -->
<SCRIPT type="text/javascript">

layui.use(['layer','form'], function () {
    var $ = layui.jquery;
    var layer = layui.layer;
	var form =layui.form;
	
	var setting = {
		async: {
			enable: true,
			url: "#(ctx)/biz/layer/getAsyncTreeData?sceneId=#(sceneId)",
			autoParam:["id", "name=n", "level=lv"],
			dataFilter: filter,
		},
		view: {
			expandSpeed:"",
			selectedMulti: false
		},
		check: {
			enable: true,
		},
		edit: {
			enable: false,
		},
		callback: {
			onCheck: onCheck,
			beforeDblClick : beforeDblClick ,
/* 			beforeCollapse: beforeCollapse,
			beforeExpand: beforeExpand,
			onCollapse: onCollapse,
			onExpand: onExpand */
		}
		
	};
	
	function filter(treeId, parentNode, childNodes) {
		if (!childNodes) return null;
		for (var i=0, l=childNodes.length; i<l; i++) {
			childNodes[i].name = childNodes[i].name?childNodes[i].name.replace(/\.n/g, '.'):'未命名';
		}
		return childNodes;
	}
	
	function beforeDblClick (treeId, treeNode) {
		if (treeNode.isParent) {
			return true;
		} else {
			defaultVFGPreview.clickForLayerTree(treeNode);
			return false;
		}
	}
	function onCheck(e, treeId, treeNode) {
		defaultVFGPreview.checkForLayerTree(treeNode);
	}
	
	$(document).ready(function(){
		$.fn.zTree.init($("#bizLayerTree"), setting);
		sceneTree= $.fn.zTree.getZTreeObj("bizLayerTree");
	});
	
	
});
</SCRIPT>